﻿using NUnit.Core.Extensibility;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PC.PickleJar.NUnit
{
	[NUnitAddin(Name="Pickle Jar", Description="Integration with the PickleJar toolset", Type=ExtensionType.Core)]
    public class Addin : IAddin
    {
		public bool Install(IExtensionHost host)
		{
			var testDecorators = host.GetExtensionPoint("TestDecorators");
			var prioritizedTestDecorators = testDecorators as IExtensionPoint2;
			if (prioritizedTestDecorators != null)
			{
				prioritizedTestDecorators.Install(new TestDecorator(), 1);
			}
			else
			{
				testDecorators.Install(new TestDecorator());
			}
			return true;
		}
	}
}
